home *** CD-ROM | disk | FTP | other *** search
/ 3D Images / 3D Images.iso / programs / amiga / rayshade / libshade / makefile.sh < prev    next >
Makefile  |  1995-01-12  |  3KB  |  130 lines

  1. case $CONFIG in
  2. '')
  3.     if test ! -f config.sh; then
  4.     ln ../config.sh . || \
  5.     ln ../../config.sh . || \
  6.     ln ../../../config.sh . || \
  7.     (echo "Can't find config.sh."; exit 1)
  8.     fi
  9.     . config.sh
  10.     ;;
  11. esac
  12. : This forces SH files to create target in same directory as SH file.
  13. : This is so that make depend always knows where to find SH derivatives.
  14. case "$0" in
  15. */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  16. esac
  17. echo "Extracting Makefile (with variable substitutions)"
  18. : This section of the file will have variable substitutions done on it.
  19. : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
  20. : Protect any dollar signs and backticks that you do not want interpreted
  21. : by putting a backslash in front.  You may delete these comments.
  22. $spitshell >Makefile <<!GROK!THIS!
  23. #
  24. # Makefile for rayshade.
  25. #
  26. # Craig Kolb
  27. #
  28. # \Makefile.SH,v 4.2 1994/08/09 23:05:22 explorer Exp
  29. #
  30. # Bin directory
  31. #
  32. BINDIR = $bin 
  33. #
  34. # If you are using LINDA, add -DLINDA
  35. # If you are running on a Multimax, add -DMULTIMAX -DSHAREDMEM
  36. # Be sure to add any necessary floating point hardware switches.
  37. OPTIMIZE = $optimize
  38. URTINC = $urtinc
  39. CCFLAGS = $ccflags $large
  40. CC = $cc
  41. MKDEP = $mkdep
  42. YACC = $yacc
  43. RANLIB = $ranlib
  44. LEX = $lex
  45.  
  46. !GROK!THIS!
  47.  
  48. : In the following dollars and backticks do not need the extra backslash.
  49. $spitshell >>Makefile <<'!NO!SUBS!'
  50. LIBRAYDIR = ../libray
  51. INCLUDE = -I.. -I$(LIBRAYDIR)
  52. YFLAGS = -d
  53.  
  54. CFLAGS = $(CCFLAGS) $(URTINC) $(INCLUDE) $(OPTIMIZE)
  55. SHELL = /bin/sh
  56.  
  57. LIB = libshade.a
  58.  
  59. SUPPORT_C =    builtin.c symtab.c misc.c lightdef.c objdef.c options.c \
  60.         stats.c surfdef.c zbuf.c
  61.  
  62. SUPPORT_H =    ../config.h datatypes.h funcdefs.h \
  63.         ../patchlevel.h rayshade.h zbuf.h
  64.  
  65. PARSE_C =    yacc.c lex.c
  66.  
  67. DRIVE_C =    setup.c viewing.c shade.c picture.c
  68.  
  69. DRIVE_H =    y.tab.h defaults.h viewing.h raytrace.h picture.h
  70.  
  71. SUPPORT_O = $(SUPPORT_C:.c=.o)
  72.  
  73. PARSE_O = $(PARSE_C:.c=.o)
  74.  
  75. DRIVE_O = $(DRIVE_C:.c=.o)
  76.  
  77. HFILES = $(DRIVE_H) $(SUPPORT_H)
  78.  
  79. CFILES = $(DRIVE_C) $(PARSE_C) $(SUPPORT_C)
  80.  
  81. SHFILES = Makefile.SH
  82.  
  83. OFILES = $(DRIVE_O) $(PARSE_O) $(SUPPORT_O)
  84.  
  85. DEPENDSRC = $(DRIVE_C) lex.l yacc.y $(SUPPORT_C)
  86.  
  87. $(LIB): $(OFILES)
  88.     ar cur $(LIB) $(OFILES)
  89.     $(RANLIB) $(LIB)
  90.  
  91. #
  92. # Uncomment the following rule if using Linda.
  93. #
  94. #raytrace.lo: raytrace.cl
  95. #    $(LCC) $(CFLAGS) -c raytrace.cl
  96.  
  97. #
  98. # End of configuration section
  99. #
  100. install:    rayshade
  101.         mv rayshade $(BINDIR)/rayshade
  102.  
  103. clean:
  104.     rm -f $(OFILES) core libshade.a
  105.  
  106. realclean:
  107.     rm -f $(OFILES) core libshade.a y.tab.h
  108.     rm -f Makefile.bak Makefile
  109.  
  110. lint:
  111.     lint $(CFLAGS) -x $(CFILES) -lm
  112.  
  113. tags:
  114.     ctags -t $(CFILES)
  115.  
  116. depend:
  117.     (sed '/^# DO NOT DELETE THIS LINE/q' Makefile && \
  118.      $(MKDEP) $(DEPENDSRC) | sed 's/: \.\//: /; /\/usr\/include/d' \
  119.     ) >Makefile.new
  120.     cp Makefile Makefile.bak
  121.     cp Makefile.new Makefile
  122.     rm -f Makefile.new
  123.  
  124.  
  125. # DO NOT DELETE THIS LINE
  126. !NO!SUBS!
  127. chmod 755 Makefile
  128. $eunicefix Makefile
  129.